package com.ABdolphin.forum.dao;

import com.ABdolphin.forum.model.Board;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BoardMapper {
    int insert(Board record);

    int insertSelective(Board record);

    Board selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Board record);

    int updateByPrimaryKey(Board record);

    Board selectByName(@Param("name") String name);

    /**
     * 返回前N个(状态正常&&未删除)的版块信息
     * @param num 返回版块信息的数量
     * @return 返回版块列表
     */
    List<Board> selectByNum(@Param("num") Integer num);
}